package com.job.sun.HomeWork0707;

import java.util.Arrays;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-08 18:36:42
 */
public class MyHelper {
    String name;
     int age;
     String major;
     public void show1(){
         System.out.println("我的名字是"+this.name+"\t我的年龄为"+this.age+"\t我的专业是"+this.major);
     }
    public double show2(int[] nums){
         double max=0;
        Arrays.sort(nums);
         for(int i=0;i<nums.length;i++){
            max +=nums[i];
         }
     if(nums[nums.length/2]<max/nums.length)
     {
         return max/nums.length;
     }else {
         return nums[nums.length/2];
     }
    }

    public MyHelper() {
    }

    public MyHelper(String name, int age, String major) {
        this.name = name;
        this.age = age;
        this.major = major;
    }

    public MyHelper(String name) {
        this.name = name;
    }

    public MyHelper(String name, int age) {
        this.name = name;
        this.age = age;
    }
}